<?php
if ( !class_exists( "Classes_Text" ) ) { 
/*

	Author:	Cedric McMillan Junior

	Date:	March 15th 2012
	
	Aim:
			Basic text class that has all strings localized in an array:

	To Do
			constructor may change to initialize the language array file rather than 
			having it elsewhere as a global variable

*/


class Classes_Text
{
	# cache object
	private $cache_object;
	
	# returns a text string from the array with the label. 
	public function GetTextString($label)
	{
		global	$gLanguageString;

		# this gets the text from array
		if	(isset($gLanguageString[$label]) == true)
		{
			# this should do the replacement
      		return	$gLanguageString[$label];
		}
	}
	
	
	# returns a text string from the array with the label. 
	public function getTextStringLanguage($label,$language)
	{
		# load the language from the cache if possible.
		$gLanguageString	=	$this->cache_object->getOrSet(CACHE_TIME_TINY,"language","$language", "getLanguageArray","$language");

		# this gets the text from array
		if	(isset($gLanguageString[$label]) == true)
		{
			# this should do the replacement
      		return	$gLanguageString[$label];
		}
	}
	
	

	# ** constructor may look at initializing the language file rather than having it elsewhere **
	public function __construct(&$cache_object,$language="en")
	{
		# create a reference to the cache object
		$this->cache_object		=	$cache_object;
    }






}


}


?>